/* 1. 基础布局 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
}

.chat-header {
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
    font-size: 16px;
    color: #333;
}

.chat-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f5f5f5;
}

/* 2. 滚动条样式 */
.chat-content::-webkit-scrollbar,
.contact-list::-webkit-scrollbar {
    width: 4px;
}

.chat-content::-webkit-scrollbar-track,
.contact-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-content::-webkit-scrollbar-thumb,
.contact-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.chat-content::-webkit-scrollbar-thumb:hover,
.contact-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* 3. 输入区域样式 */
.chat-input {
    padding: 10px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input textarea {
    resize: none;
    border: none;
    width: 100%;
    background: #fff;
}

.chat-input textarea:focus {
    outline: none;
    box-shadow: none;
}

.input-tools {
    display: flex;
    gap: 10px;
    padding: 5px;
}

.tool-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #666;
}

.send-btn-container {
    display: flex;
    justify-content: flex-end;
    padding: 5px;
}

#send-btn {
    background-color: #28c1fd;
    border: none;
    color: #000;
    padding: 5px 15px;
    border-radius: 4px;
}

#send-btn:hover {
    background-color: #28a5ff;
}

/* 4. 消息样式 */
.message-wrapper {
    margin: 4px 10px;
    display: flex;
}

.message-left {
    padding-right: 45%;
}

.message-right {
    padding-left: 45%;
    justify-content: flex-end;
}

.message-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
}

.message-right .message-container {
    align-items: flex-end;
}

.username {
    font-size: 12px;
    color: #999;
    padding: 0 4px;
    margin-bottom: 2px;
}

.message-content {
    display: flex;
    width: 100%;
}

.message-bubble {
    padding: 10px 15px;
    word-wrap: break-word;
    min-width: 40px;
}

.message-left .message-bubble {
    background-color: #fff;
    border-radius: 4px 12px 12px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-right .message-bubble {
    background-color: #0099ff;
    color: white;
    border-radius: 12px 4px 12px 12px;
}

.message-time {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin: 8px 0;
    clear: both;
}

/* 5. 联系人列表基础样式 */
#contact-list {
    height: 100%;
    overflow-y: auto;
    background-color: #fff;
}

/* 添加加载状态和错误提示样式 */
.loading-indicator,
.error-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error-message {
    color: #dc3545;
}
